/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateTaller1PDSData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.Taller1PDSPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.Pacient lormPacient = orm.PacientDAO.createPacient();
			// Initialize the properties of the persistent object here
			orm.PacientDAO.save(lormPacient);
			orm.User lormUser = orm.UserDAO.createUser();
			// Initialize the properties of the persistent object here
			orm.UserDAO.save(lormUser);
			orm.Doctor lormDoctor = orm.DoctorDAO.createDoctor();
			// Initialize the properties of the persistent object here
			orm.DoctorDAO.save(lormDoctor);
			orm.BabyMonitor lormBabyMonitor = orm.BabyMonitorDAO.createBabyMonitor();
			// Initialize the properties of the persistent object here
			orm.BabyMonitorDAO.save(lormBabyMonitor);
			orm.Solution lormSolution = orm.SolutionDAO.createSolution();
			// Initialize the properties of the persistent object here
			orm.SolutionDAO.save(lormSolution);
			orm.Diagnose lormDiagnose = orm.DiagnoseDAO.createDiagnose();
			// Initialize the properties of the persistent object here
			orm.DiagnoseDAO.save(lormDiagnose);
			orm.Response lormResponse = orm.ResponseDAO.createResponse();
			// Initialize the properties of the persistent object here
			orm.ResponseDAO.save(lormResponse);
			orm.Question lormQuestion = orm.QuestionDAO.createQuestion();
			// Initialize the properties of the persistent object here
			orm.QuestionDAO.save(lormQuestion);
			orm.QuestForm lormQuestForm = orm.QuestFormDAO.createQuestForm();
			// Initialize the properties of the persistent object here
			orm.QuestFormDAO.save(lormQuestForm);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateTaller1PDSData createTaller1PDSData = new CreateTaller1PDSData();
			try {
				createTaller1PDSData.createTestData();
			}
			finally {
				orm.Taller1PDSPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
